import lsRequest from "../index"
import { IChatFriendListsResult, IChatFriendRecord } from "./types"
import { IdataType } from "../types"
enum chatType {
  GetFriendLists = "/chat/friendLists",
  GetCurrentChatRecords = "/chat/friendChatRecord"
}

//获取好友列表
export function getFriendLists() {
  return lsRequest.get<IdataType<IChatFriendListsResult>>({
    url: chatType.GetFriendLists
  })
}

//获取与某一好友聊天内容
export function getFriendChatRecord(params: {
  userId: number
  friendId: number
}) {
  return lsRequest.get<IdataType<IChatFriendRecord>>({
    url: chatType.GetCurrentChatRecords,
    params
  })
}
